package uk.co.caistealcourt.intellij.plugins.mavenone;

import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleComponent;
import com.intellij.openapi.ui.Messages;
import com.intellij.psi.search.GlobalSearchScope;
import org.jetbrains.annotations.NotNull;

public class ModuleDependencies implements ModuleComponent {
    private Module module;

    public ModuleDependencies(Module module) {
        this.module = module;
    }

    public void initComponent() {

    }

    public void disposeComponent() {
    }

    @NotNull
    public String getComponentName() {
        return "MavenOne.ModuleDependencies";
    }

    public void projectOpened() {
    }

    public void projectClosed() {
    }

    public void moduleAdded() {
        Messages.showMessageDialog("Module Added " + module.getName(), "Module Information", Messages.getInformationIcon());
        GlobalSearchScope deps = module.getModuleWithDependenciesAndLibrariesScope(true);
        Messages.showMessageDialog(deps.getDisplayName(), "Module Information", Messages.getInformationIcon());

    }
}
